package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.InHospitalReservationQuery;
import com.mk.admin.model.vo.InHospitalReservationVo;
import com.mk.admin.service.InHospitalReservationService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/inHospitalReservation")
@Api(tags = "住院预约")
public class InHospitalReservationController {
    @Autowired
    private InHospitalReservationService inHospitalReservationService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody InHospitalReservationQuery query) {
        return inHospitalReservationService.select(query);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody InHospitalReservationVo inHospitalReservationVo) {
        return inHospitalReservationService.add(inHospitalReservationVo);
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody InHospitalReservationVo inHospitalReservationVo) {
        return inHospitalReservationService.update(inHospitalReservationVo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody InHospitalReservationVo inHospitalReservationVo) {
        return inHospitalReservationService.delete(inHospitalReservationVo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody InHospitalReservationVo inHospitalReservationVo) {
        return inHospitalReservationService.status(inHospitalReservationVo.getId());
    }
}
